import React, { Component } from 'react'
import Hello from './components/Hello'

export default class App extends Component {

  state = {
    name: 'xiaozhu'
  }
  changeName = () => {
    this.setState({
      name: '猪仔'
    })
  }
  render () {
    const { name } = this.state
    return (
      <div>
        <button onClick={this.changeName}>更改name</button>
        <Hello name={name} />
      </div>
    )
  }
}
